package com.myGisChannel.utils;

import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.myGis.entities.SimpleField;

public class BuildFormUtils {

	public static JSONArray getCustomForm(List<SimpleField> simplefields){
		//JSONObject customForm = new JSONObject();
		JSONArray  arrayJSon = new JSONArray();
		for(SimpleField simpleField:simplefields){
			JSONObject itemCustomForm = new JSONObject();
			itemCustomForm.put("nombre_campo", simpleField.getName());
			itemCustomForm.put("tipo_campo", simpleField.getType());
			itemCustomForm.put("simpleFieldId", simpleField.getSimpleFieldId());
			arrayJSon.put(itemCustomForm);
		}
		return arrayJSon;
	}
}
